package com.tingyuge.base.thread.wang.chapter5;

public class ThreadJoin2 {
    public static void main(String[] args) throws InterruptedException {
       Thread t1 = new Thread(()->{

           try {
               System.out.println("t1 is running");
               Thread.sleep(10_000);
               System.out.println("t1 is done");
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
       });
       t1.start();
       t1.join(1000);
        System.out.println("main thread");
    }
}
